OTResolveAddress
Returns the protocol address that corresponds to the name of an endpoint.C INTERFACE
OSStatus OTResolveAddress(EndpointRef ref, TBind* req, TBind* ret);C++ INTERFACE
OSStatus TEndpoint::ResolveAddress(TBind* req, TBind* ret);PARAMETERS
ref
- The endpoint reference of the endpoint whose address is sought.
req
- A pointer to a
TBind
structure (page 3-51). Thereq->addr.buf
field points to a buffer containing the name of the endpoint, which must be in an appropriate format for the protocol family. For example, for AppleTalk this must be an NBP address.ret
- A pointer to a
TBind
structure (page 3-51). Theret->addr.buf
field points to a buffer containing the lowest-level address that corresponds to the address pointed to by thereq->addr.buf
field of thereq
parameter.DESCRIPTION
TheOTResolveAddress
function returns the lowest-level address for your endpoint. Not all endpoints support this function. A value ofCAN_RESOLVE_ADDR
in theflags
field of theTEndpointInfo
structure indicates that the endpoint does support this function. Using this function saves you the trouble of opening and closing a mapper provider if the only reason you have for opening the mapper is to look up the address corresponding to a specific endpoint name. You would still have to open the mapper if you needed to look up a name pattern--that is, if the name included any wildcard characters.You are responsible for initializing the buffers described by the
req
andret
parameters required to hold the addresses. To determine how large these buffers should be, examine theaddr
field of theTEndpointInfo
structure, which specifies the maximum amount of memory needed to store an address for the endpoint specified by theref
parameter.If a notifier is not installed, it is not possible to determine when the
OTResolveAddress
function completes.COMPLETION EVENT CODES
T_RESOLVEADDRCOMPLETE
0x20000009 The OTResolveAddress
function has completed. Thecookie
parameter of the notifier function contains theresult
parameter.VALID STATES
All states are valid exceptT_UNINT.
SEE ALSO
For additional information about the format used to describe the address passed in theret
parameter, please consult the documentation provided for the protocol you are using as the lowest-level protocol.The TBind structure (page 3-51) describes the address to which an endpoint
is bound.The
flags
field (page 3-45) of theTEndpointInfo
structure (page 3-48) indicates whether the endpoint supports this function.